The tremendous promise of electronic health records (EHR) to improve the quality and safety of healthcare has gone unrealized. Hospitalized patients- particularly those admitted for general surgical procedures- continue to face increased risk of adverse outcomes, including death, complications, readmissions and substandard care. One potential reason that EHR adoption has not resulted in widespread improvements in care is that administrators lack critical evidence regarding the context in which these technology systems function best. Organizational theory literature suggests that institutional characteristics such as managerial support and organizational climate are essential to the successful implementation of innovations, such as technology. Yet, there has been little to no attention in the empirical healthcare literature given to whether the relationship between EHR use and clinical patient outcomes in hospitals is conditional on the broader work environment, particularly of nurses- the largest group of direct care providers and EHR users in hospitals. This application uses nurses' reports to measure features of the work environment related to nurses' engagement in the organization and resource adequacy, in addition to staffing levels and evaluations of EHR effectiveness. The study aims to determine not only whether EHR adoption is related to better patient outcomes, but also whether EHR effectiveness hinges upon having an organizational structure that supports professional nursing practice. We expect to find that patients treated in hospitals with better environments and better staffing will have greater EHR use, more positive evaluations of EHR effectiveness, and better patient outcomes. We also expect that more pronounced changes in the breadth and depth of EHR use will produce greater improvements in patient outcomes, and that both changes may be conditional on nurse work environments and nurse staffing. The full advantage of EHR technology may be best realized in hospitals where nurses are supported in their practice, are involved in institutional decision-making regarding delivery of patient care, and have adequate staffing support. Guided by sociotechnical systems theory, this study of hundreds of hospitals in 4 large U.S. states will employ both cross-sectional and longitudinal panel methods using unique nurse survey data collected before and after implementation of EHR legislation linked with the American Hospital Association Annual Survey Information Technology (IT) Supplement, and administrative patient discharge data from over 2 million surgical patients collected in 2006/2007 and 2015. Patient outcomes that will be examined include: 30-day mortality, failure-to-rescue, readmission, and AHRQ patient safety indicators. Given the rapid diffusion of IT, our findings could improve successful implementation of EHR systems. This study is a critical step towards a more comprehensive understanding of the conditions under which EHR systems function best in their intended purpose of facilitating evidence-based care and improving care coordination and communication between patients, families, and providers.